<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BabyOS: b_menu.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="2.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BabyOS
   &#160;<span id="projectnumber">V2.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b9223522bb56aee4ab59f7ba381d2163.html">bos</a></li><li class="navelem"><a class="el" href="dir_f2a2cc749b6bfcea90db6730434b0bd6.html">core</a></li><li class="navelem"><a class="el" href="dir_7991448cbe81caff9afaadef11b942e8.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">b_menu.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="b__menu_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment">/*Includes ----------------------------------------------*/</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="b__menu_8h.html">b_menu.h</a>&quot;</span>  </div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#if _MENU_ENABLE</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;<span class="keyword">static</span> <a class="code" href="structb_menu_item.html">bMenuItem_t</a> bMenuItemTable[<a class="code" href="b__config_8h.html#a35558a64c285c686d183d0214e0bbed9">_MENU_ITEM_NUMBER</a>];</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="keyword">static</span> uint8_t ItemIndex = 0;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="keyword">static</span> <a class="code" href="structb_menu_item.html">bMenuItem_t</a> *pC_Item = <a class="code" href="b__config_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="keyword">static</span> uint32_t Pre_ID = 0;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="keyword">static</span> <span class="keywordtype">int</span> _bMenuFindIndex(uint32_t <span class="keywordtype">id</span>)</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;{</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="keywordtype">int</span> i = 0;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keywordflow">for</span>(i = 0;i &lt; ItemIndex;i++)</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    {</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        <span class="keywordflow">if</span>(bMenuItemTable[i].<span class="keywordtype">id</span> == <span class="keywordtype">id</span>)</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        {</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;            <span class="keywordflow">return</span> i;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;        }</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    }</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;}    </div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___m_e_n_u___exported___functions.html#gaaa960c2d2873f4115ab72025c2e249d8">bMenuAddSibling</a>(uint32_t ref_id, uint32_t <span class="keywordtype">id</span>, <a class="code" href="group___m_e_n_u___exported___types_definitions.html#ga69f5614c73548c92f144c9b499a23302">pCreateUI</a> f)</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;{</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keywordtype">int</span> i = 0;</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <a class="code" href="structb_menu_item.html">bMenuItem_t</a> *ptmp, *pref = <a class="code" href="b__config_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <span class="keywordflow">if</span>(ItemIndex &gt;= <a class="code" href="b__config_8h.html#a35558a64c285c686d183d0214e0bbed9">_MENU_ITEM_NUMBER</a>)</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    {</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    }</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    ptmp = &amp;bMenuItemTable[ItemIndex];</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    ptmp-&gt;<a class="code" href="structb_menu_item.html#abaabdc509cdaba7df9f56c6c76f3ae19">id</a> = id;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    ptmp-&gt;<a class="code" href="structb_menu_item.html#a247b9bc15b9b38d3c1541b9999249ce5">create_ui</a> = f;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    ptmp-&gt;<a class="code" href="structb_menu_item.html#a81b50196ed90c63596da2ace4dd2a97b">visible</a> = 1;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="keywordflow">if</span>(ref_id == <span class="keywordtype">id</span>)</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    {</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;        ptmp-&gt;<a class="code" href="structb_menu_item.html#a8caaa031d0d22a8243a5275cd78ff3ce">child</a> = ptmp-&gt;<a class="code" href="structb_menu_item.html#a7a208733d75d00aa05b1b570b554e46e">parent</a> = ptmp-&gt;<a class="code" href="structb_menu_item.html#affd147fae2bf002d968438e518d21c82">next</a> = ptmp-&gt;<a class="code" href="structb_menu_item.html#aab72176f9919a9e3931cf5b2c46f66e7">prev</a> = ptmp;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    }</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="keywordflow">else</span></div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    {</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;        <span class="keywordflow">if</span>((i = _bMenuFindIndex(ref_id)) &lt; 0)</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        {</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;            <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;        }</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;        pref = &amp;bMenuItemTable[i];</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;        </div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;        ptmp-&gt;<a class="code" href="structb_menu_item.html#aab72176f9919a9e3931cf5b2c46f66e7">prev</a> = pref;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;        pref-&gt;<a class="code" href="structb_menu_item.html#affd147fae2bf002d968438e518d21c82">next</a>-&gt;<a class="code" href="structb_menu_item.html#aab72176f9919a9e3931cf5b2c46f66e7">prev</a> = ptmp;</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;        ptmp-&gt;<a class="code" href="structb_menu_item.html#affd147fae2bf002d968438e518d21c82">next</a> = pref-&gt;<a class="code" href="structb_menu_item.html#affd147fae2bf002d968438e518d21c82">next</a>;</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        pref-&gt;<a class="code" href="structb_menu_item.html#affd147fae2bf002d968438e518d21c82">next</a> = ptmp;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;        ptmp-&gt;<a class="code" href="structb_menu_item.html#a7a208733d75d00aa05b1b570b554e46e">parent</a> = pref-&gt;<a class="code" href="structb_menu_item.html#a7a208733d75d00aa05b1b570b554e46e">parent</a>;</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;        ptmp-&gt;<a class="code" href="structb_menu_item.html#a8caaa031d0d22a8243a5275cd78ff3ce">child</a> = ptmp;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    }</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <span class="keywordflow">if</span>(pC_Item == <a class="code" href="b__config_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    {</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;        pC_Item = ptmp;</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        Pre_ID = ptmp-&gt;<a class="code" href="structb_menu_item.html#abaabdc509cdaba7df9f56c6c76f3ae19">id</a>;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;        <span class="keywordflow">if</span>(pC_Item-&gt;<a class="code" href="structb_menu_item.html#a247b9bc15b9b38d3c1541b9999249ce5">create_ui</a>)</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;        {</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;            pC_Item-&gt;<a class="code" href="structb_menu_item.html#a247b9bc15b9b38d3c1541b9999249ce5">create_ui</a>(Pre_ID);</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;        }</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    }</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    ItemIndex += 1;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    <span class="keywordflow">return</span> ItemIndex;</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;}</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___m_e_n_u___exported___functions.html#ga8ec84642e8453c74118b50ea4538f61b">bMenuAddChild</a>(uint32_t ref_id, uint32_t <span class="keywordtype">id</span>, <a class="code" href="group___m_e_n_u___exported___types_definitions.html#ga69f5614c73548c92f144c9b499a23302">pCreateUI</a> f)</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;{</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    <span class="keywordtype">int</span> i = 0;</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    <a class="code" href="structb_menu_item.html">bMenuItem_t</a> *ptmp, *pref = <a class="code" href="b__config_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="keywordflow">if</span>(ItemIndex &gt;= <a class="code" href="b__config_8h.html#a35558a64c285c686d183d0214e0bbed9">_MENU_ITEM_NUMBER</a>)</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    {</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    }</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    </div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    ptmp = &amp;bMenuItemTable[ItemIndex];</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    ptmp-&gt;<a class="code" href="structb_menu_item.html#abaabdc509cdaba7df9f56c6c76f3ae19">id</a> = id;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    ptmp-&gt;<a class="code" href="structb_menu_item.html#a247b9bc15b9b38d3c1541b9999249ce5">create_ui</a> = f;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    ptmp-&gt;<a class="code" href="structb_menu_item.html#a81b50196ed90c63596da2ace4dd2a97b">visible</a> = 1;    </div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    <span class="keywordflow">if</span>((i = _bMenuFindIndex(ref_id)) &lt; 0)</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    {</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    }</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    pref = &amp;bMenuItemTable[i];</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    </div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    ptmp-&gt;<a class="code" href="structb_menu_item.html#a8caaa031d0d22a8243a5275cd78ff3ce">child</a> = ptmp-&gt;<a class="code" href="structb_menu_item.html#affd147fae2bf002d968438e518d21c82">next</a> = ptmp-&gt;<a class="code" href="structb_menu_item.html#aab72176f9919a9e3931cf5b2c46f66e7">prev</a> = ptmp;  </div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;    ptmp-&gt;<a class="code" href="structb_menu_item.html#a7a208733d75d00aa05b1b570b554e46e">parent</a> = pref;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    pref-&gt;<a class="code" href="structb_menu_item.html#a8caaa031d0d22a8243a5275cd78ff3ce">child</a> = ptmp;</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    ItemIndex += 1;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    <span class="keywordflow">return</span> ItemIndex;</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;}</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___m_e_n_u___exported___functions.html#gaccc45ecdf5fa48d56cbbaf3888fed568">bMenuAction</a>(uint8_t cmd)</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;{</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    <a class="code" href="structb_menu_item.html">bMenuItem_t</a> *c = pC_Item;</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;    <span class="keywordflow">switch</span>(cmd)</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    {</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;        <span class="keywordflow">case</span> <a class="code" href="group___m_e_n_u___exported___defines.html#gafd6e6d4a623b9db29e5da2e85fe4b679">MENU_UP</a>:</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;            <span class="keywordflow">do</span></div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;            {</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;                c = c-&gt;<a class="code" href="structb_menu_item.html#aab72176f9919a9e3931cf5b2c46f66e7">prev</a>;</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;            }<span class="keywordflow">while</span>(c-&gt;<a class="code" href="structb_menu_item.html#a81b50196ed90c63596da2ace4dd2a97b">visible</a> == 0);</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;        <span class="keywordflow">case</span> <a class="code" href="group___m_e_n_u___exported___defines.html#gaf4b9d343a946b57cea1efdd357de259b">MENU_DOWN</a>:</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;            <span class="keywordflow">do</span></div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;            {</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;                c = c-&gt;<a class="code" href="structb_menu_item.html#affd147fae2bf002d968438e518d21c82">next</a>;</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;            }<span class="keywordflow">while</span>(c-&gt;<a class="code" href="structb_menu_item.html#a81b50196ed90c63596da2ace4dd2a97b">visible</a> == 0);</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;        <span class="keywordflow">case</span> <a class="code" href="group___m_e_n_u___exported___defines.html#gae81a0a27142ec4047577169a5afd80d4">MENU_BACK</a>:</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;            <span class="keywordflow">if</span>(c-&gt;<a class="code" href="structb_menu_item.html#a7a208733d75d00aa05b1b570b554e46e">parent</a>-&gt;<a class="code" href="structb_menu_item.html#a81b50196ed90c63596da2ace4dd2a97b">visible</a> != 0)</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;            {</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;                c = c-&gt;<a class="code" href="structb_menu_item.html#a7a208733d75d00aa05b1b570b554e46e">parent</a>;</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;            }</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;        <span class="keywordflow">case</span> <a class="code" href="group___m_e_n_u___exported___defines.html#ga338e16971a67fd5438ee3b3f883b07da">MENU_ENTER</a>:</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;            <span class="keywordflow">if</span>(c-&gt;<a class="code" href="structb_menu_item.html#a8caaa031d0d22a8243a5275cd78ff3ce">child</a>-&gt;<a class="code" href="structb_menu_item.html#a81b50196ed90c63596da2ace4dd2a97b">visible</a> != 0)</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;            {</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;                c = c-&gt;<a class="code" href="structb_menu_item.html#a8caaa031d0d22a8243a5275cd78ff3ce">child</a>;</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;            }</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;        <span class="keywordflow">default</span>:</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    }</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    <span class="keywordflow">if</span>(c != pC_Item)</div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    {</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        pC_Item = c;</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;        <span class="keywordflow">if</span>(pC_Item-&gt;<a class="code" href="structb_menu_item.html#a247b9bc15b9b38d3c1541b9999249ce5">create_ui</a>)</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;        {</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;            pC_Item-&gt;<a class="code" href="structb_menu_item.html#a247b9bc15b9b38d3c1541b9999249ce5">create_ui</a>(Pre_ID);</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;        }</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;        Pre_ID = pC_Item-&gt;<a class="code" href="structb_menu_item.html#abaabdc509cdaba7df9f56c6c76f3ae19">id</a>;</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    }</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;}</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___m_e_n_u___exported___functions.html#ga7acf282f020822cdcb12b76ea2144290">bMenuJump</a>(uint32_t <span class="keywordtype">id</span>)</div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;{</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;    <span class="keywordtype">int</span> i = 0;</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    <a class="code" href="structb_menu_item.html">bMenuItem_t</a> *c;</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    <span class="keywordflow">if</span>((i = _bMenuFindIndex(<span class="keywordtype">id</span>)) &lt; 0)</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;    {</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;        <span class="keywordflow">return</span>;</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;    }</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    c = &amp;bMenuItemTable[i];</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;    <span class="keywordflow">if</span>(c-&gt;<a class="code" href="structb_menu_item.html#a81b50196ed90c63596da2ace4dd2a97b">visible</a> &amp;&amp; c != pC_Item)</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;    {</div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;        pC_Item = c;</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;        <span class="keywordflow">if</span>(pC_Item-&gt;<a class="code" href="structb_menu_item.html#a247b9bc15b9b38d3c1541b9999249ce5">create_ui</a>)</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;        {</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;            pC_Item-&gt;<a class="code" href="structb_menu_item.html#a247b9bc15b9b38d3c1541b9999249ce5">create_ui</a>(Pre_ID);</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;        }</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;        Pre_ID = pC_Item-&gt;<a class="code" href="structb_menu_item.html#abaabdc509cdaba7df9f56c6c76f3ae19">id</a>; </div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;    }</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;}</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___m_e_n_u___exported___functions.html#ga39126ec066d7feed10c170f4a8fdfdd0">bMenuSetVisible</a>(uint32_t <span class="keywordtype">id</span>, uint8_t s)</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;{</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;    <span class="keywordtype">int</span> i = 0;</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;    <a class="code" href="structb_menu_item.html">bMenuItem_t</a> *c;</div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;    <span class="keywordflow">if</span>((i = _bMenuFindIndex(<span class="keywordtype">id</span>)) &lt; 0)</div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;    {</div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;    }</div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;    c = &amp;bMenuItemTable[i];</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;    <span class="keywordflow">if</span>(s)</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;    {</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;        c-&gt;<a class="code" href="structb_menu_item.html#a81b50196ed90c63596da2ace4dd2a97b">visible</a> = 1;</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;    }</div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;    <span class="keywordflow">else</span></div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    {</div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;        c-&gt;<a class="code" href="structb_menu_item.html#a81b50196ed90c63596da2ace4dd2a97b">visible</a> = 0;</div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    }</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;}</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;</div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;uint32_t <a class="code" href="group___m_e_n_u___exported___functions.html#gafdcdf577531d8161ffd51ba56f668d97">bMenuCurrentID</a>()</div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;{</div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    <span class="keywordflow">return</span> Pre_ID; </div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;}</div><div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;</div><div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;<span class="comment">/************************ Copyright (c) 2020 Bean *****END OF FILE****/</span></div><div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;</div><div class="ttc" id="b__config_8h_html_a35558a64c285c686d183d0214e0bbed9"><div class="ttname"><a href="b__config_8h.html#a35558a64c285c686d183d0214e0bbed9">_MENU_ITEM_NUMBER</a></div><div class="ttdeci">#define _MENU_ITEM_NUMBER</div><div class="ttdef"><b>Definition:</b> <a href="b__config_8h_source.html#l00179">b_config.h:179</a></div></div>
<div class="ttc" id="structb_menu_item_html_a7a208733d75d00aa05b1b570b554e46e"><div class="ttname"><a href="structb_menu_item.html#a7a208733d75d00aa05b1b570b554e46e">bMenuItem::parent</a></div><div class="ttdeci">struct bMenuItem * parent</div><div class="ttdef"><b>Definition:</b> <a href="b__menu_8h_source.html#l00066">b_menu.h:66</a></div></div>
<div class="ttc" id="b__config_8h_html_a070d2ce7b6bb7e5c05602aa8c308d0c4"><div class="ttname"><a href="b__config_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a></div><div class="ttdeci">#define NULL</div><div class="ttdef"><b>Definition:</b> <a href="b__config_8h_source.html#l00042">b_config.h:42</a></div></div>
<div class="ttc" id="structb_menu_item_html_a8caaa031d0d22a8243a5275cd78ff3ce"><div class="ttname"><a href="structb_menu_item.html#a8caaa031d0d22a8243a5275cd78ff3ce">bMenuItem::child</a></div><div class="ttdeci">struct bMenuItem * child</div><div class="ttdef"><b>Definition:</b> <a href="b__menu_8h_source.html#l00067">b_menu.h:67</a></div></div>
<div class="ttc" id="b__menu_8h_html"><div class="ttname"><a href="b__menu_8h.html">b_menu.h</a></div></div>
<div class="ttc" id="group___m_e_n_u___exported___functions_html_ga8ec84642e8453c74118b50ea4538f61b"><div class="ttname"><a href="group___m_e_n_u___exported___functions.html#ga8ec84642e8453c74118b50ea4538f61b">bMenuAddChild</a></div><div class="ttdeci">int bMenuAddChild(uint32_t ref_id, uint32_t id, pCreateUI f)</div></div>
<div class="ttc" id="group___m_e_n_u___exported___defines_html_gaf4b9d343a946b57cea1efdd357de259b"><div class="ttname"><a href="group___m_e_n_u___exported___defines.html#gaf4b9d343a946b57cea1efdd357de259b">MENU_DOWN</a></div><div class="ttdeci">#define MENU_DOWN</div><div class="ttdef"><b>Definition:</b> <a href="b__menu_8h_source.html#l00084">b_menu.h:84</a></div></div>
<div class="ttc" id="group___m_e_n_u___exported___types_definitions_html_ga69f5614c73548c92f144c9b499a23302"><div class="ttname"><a href="group___m_e_n_u___exported___types_definitions.html#ga69f5614c73548c92f144c9b499a23302">pCreateUI</a></div><div class="ttdeci">void(* pCreateUI)(uint32_t pre_id)</div><div class="ttdef"><b>Definition:</b> <a href="b__menu_8h_source.html#l00057">b_menu.h:57</a></div></div>
<div class="ttc" id="structb_menu_item_html_a247b9bc15b9b38d3c1541b9999249ce5"><div class="ttname"><a href="structb_menu_item.html#a247b9bc15b9b38d3c1541b9999249ce5">bMenuItem::create_ui</a></div><div class="ttdeci">pCreateUI create_ui</div><div class="ttdef"><b>Definition:</b> <a href="b__menu_8h_source.html#l00068">b_menu.h:68</a></div></div>
<div class="ttc" id="structb_menu_item_html_abaabdc509cdaba7df9f56c6c76f3ae19"><div class="ttname"><a href="structb_menu_item.html#abaabdc509cdaba7df9f56c6c76f3ae19">bMenuItem::id</a></div><div class="ttdeci">uint32_t id</div><div class="ttdef"><b>Definition:</b> <a href="b__menu_8h_source.html#l00063">b_menu.h:63</a></div></div>
<div class="ttc" id="group___m_e_n_u___exported___functions_html_ga7acf282f020822cdcb12b76ea2144290"><div class="ttname"><a href="group___m_e_n_u___exported___functions.html#ga7acf282f020822cdcb12b76ea2144290">bMenuJump</a></div><div class="ttdeci">void bMenuJump(uint32_t id)</div></div>
<div class="ttc" id="structb_menu_item_html"><div class="ttname"><a href="structb_menu_item.html">bMenuItem</a></div><div class="ttdef"><b>Definition:</b> <a href="b__menu_8h_source.html#l00061">b_menu.h:61</a></div></div>
<div class="ttc" id="group___m_e_n_u___exported___functions_html_gaaa960c2d2873f4115ab72025c2e249d8"><div class="ttname"><a href="group___m_e_n_u___exported___functions.html#gaaa960c2d2873f4115ab72025c2e249d8">bMenuAddSibling</a></div><div class="ttdeci">int bMenuAddSibling(uint32_t ref_id, uint32_t id, pCreateUI f)</div></div>
<div class="ttc" id="structb_menu_item_html_affd147fae2bf002d968438e518d21c82"><div class="ttname"><a href="structb_menu_item.html#affd147fae2bf002d968438e518d21c82">bMenuItem::next</a></div><div class="ttdeci">struct bMenuItem * next</div><div class="ttdef"><b>Definition:</b> <a href="b__menu_8h_source.html#l00065">b_menu.h:65</a></div></div>
<div class="ttc" id="group___m_e_n_u___exported___defines_html_ga338e16971a67fd5438ee3b3f883b07da"><div class="ttname"><a href="group___m_e_n_u___exported___defines.html#ga338e16971a67fd5438ee3b3f883b07da">MENU_ENTER</a></div><div class="ttdeci">#define MENU_ENTER</div><div class="ttdef"><b>Definition:</b> <a href="b__menu_8h_source.html#l00086">b_menu.h:86</a></div></div>
<div class="ttc" id="group___m_e_n_u___exported___functions_html_gaccc45ecdf5fa48d56cbbaf3888fed568"><div class="ttname"><a href="group___m_e_n_u___exported___functions.html#gaccc45ecdf5fa48d56cbbaf3888fed568">bMenuAction</a></div><div class="ttdeci">void bMenuAction(uint8_t cmd)</div></div>
<div class="ttc" id="structb_menu_item_html_a81b50196ed90c63596da2ace4dd2a97b"><div class="ttname"><a href="structb_menu_item.html#a81b50196ed90c63596da2ace4dd2a97b">bMenuItem::visible</a></div><div class="ttdeci">uint8_t visible</div><div class="ttdef"><b>Definition:</b> <a href="b__menu_8h_source.html#l00069">b_menu.h:69</a></div></div>
<div class="ttc" id="group___m_e_n_u___exported___defines_html_gafd6e6d4a623b9db29e5da2e85fe4b679"><div class="ttname"><a href="group___m_e_n_u___exported___defines.html#gafd6e6d4a623b9db29e5da2e85fe4b679">MENU_UP</a></div><div class="ttdeci">#define MENU_UP</div><div class="ttdef"><b>Definition:</b> <a href="b__menu_8h_source.html#l00083">b_menu.h:83</a></div></div>
<div class="ttc" id="group___m_e_n_u___exported___functions_html_gafdcdf577531d8161ffd51ba56f668d97"><div class="ttname"><a href="group___m_e_n_u___exported___functions.html#gafdcdf577531d8161ffd51ba56f668d97">bMenuCurrentID</a></div><div class="ttdeci">uint32_t bMenuCurrentID(void)</div></div>
<div class="ttc" id="group___m_e_n_u___exported___defines_html_gae81a0a27142ec4047577169a5afd80d4"><div class="ttname"><a href="group___m_e_n_u___exported___defines.html#gae81a0a27142ec4047577169a5afd80d4">MENU_BACK</a></div><div class="ttdeci">#define MENU_BACK</div><div class="ttdef"><b>Definition:</b> <a href="b__menu_8h_source.html#l00085">b_menu.h:85</a></div></div>
<div class="ttc" id="structb_menu_item_html_aab72176f9919a9e3931cf5b2c46f66e7"><div class="ttname"><a href="structb_menu_item.html#aab72176f9919a9e3931cf5b2c46f66e7">bMenuItem::prev</a></div><div class="ttdeci">struct bMenuItem * prev</div><div class="ttdef"><b>Definition:</b> <a href="b__menu_8h_source.html#l00064">b_menu.h:64</a></div></div>
<div class="ttc" id="group___m_e_n_u___exported___functions_html_ga39126ec066d7feed10c170f4a8fdfdd0"><div class="ttname"><a href="group___m_e_n_u___exported___functions.html#ga39126ec066d7feed10c170f4a8fdfdd0">bMenuSetVisible</a></div><div class="ttdeci">int bMenuSetVisible(uint32_t id, uint8_t s)</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
